package XMLread;

import com.google.android.maps.GeoPoint;

/**
 * This object represents an intersection in a floor of a building.
 */
public class Intersection {
	private String interID;
	private GeoPoint geopoint;
	
	/**
	 * Constructor for this intersection object.
	 * @param id the ID of this intersection
	 * @param latit the latitude coordinate of this intersection
	 * @param longit the longitude coordinate of this intersection
	 */
	public Intersection(String id, double latit, double longit){
		this.setInterID(id);
		setGeopoint(latit, longit);		
	}
	
	/**
	 * Returns the ID of this intersection.
	 * @return the ID of this intersection.
	 */
	public String getInterID() {
		return interID;
	}
	
	/**
	 * Sets the ID of this intersection.
	 * @param the new ID of this intersection.
	 */
	public void setInterID(String interID) {
		this.interID = interID;
	}	

	/**
	 * Returns the location of this intersection as a GeoPoint.
	 * @return the GeoPoint representing the location of this intersection.
	 */
	public GeoPoint getGeopoint() {
		return geopoint;
	}

	/**
	 * Sets the position of this intersection.
	 * @param latitude the new value representing the latitude coordinate of this intersection.
	 * @param longitude the new value representing the longitude coordinate of this intersection.
	 */
	public void setGeopoint(double latitude, double longitude) {
		this.geopoint = new GeoPoint((int) (latitude * 1e6), (int) (longitude * 1e6));
	}
}
